<template>
	<view class="com">
		<swiper class="swiper" 
		   :indicator-dots="indicatorDots"
		   :current="current"
		   :autoplay="autoplay" 
		   :interval="interval" 
		   :duration="duration"
		   :circular="true"
		   @change="change">
			<swiper-item v-for="(item,index) in imgs" :key="index">
				<image :src="item+'?x-oss-process=image/resize,w_500'" class="imgs" mode="aspectFill"></image>
			</swiper-item>
		</swiper>
		<view class="indicatorDots text_after">
			<text class="indicatorDots-te size26">{{current + 1}}/</text>
			<text class="indicatorDots-all textBai size26">{{imgs.length}}</text>
		</view>
		<view class="swiper-date size22" v-if="tips">
			<text class="size26">{{day}}</text>天行程
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			imgs:{
				type:Array,
				default:()=>{
					return []
				}
			},
			day:{
				type:Number,
				default:0
			},
			indicatorDots:{
				type:Boolean,
				default:false
			},
			autoplay:{
				type:Boolean,
				default:true
			},
			interval:{
				type:Number,
				default:5000
			},
			duration:{
				type:Number,
				default:500
			},
			tips:{
				type:Boolean,
				default:true
			}
		},
		data() {
			return {
				current:0
			};
		},
		methods:{
			change(e){
				// console.log(e)
				this.current = e.detail.current;
			}
		}
	}
</script>

<style lang="scss">
	.swiper{
		width: 100%;
		height: 360upx;
		position: relative;
		.imgs{
			width: 100%;
			height: 100%;
		}
	}
	.com{
		width: 100%;
		height: 360upx;
		position: relative;
		.indicatorDots{
			position: absolute;
			display:block;
			padding:0 18upx;
			background-color: rgba(0,0,0,.4);
			right: 24upx;
			bottom: 20upx;
			border-radius:25upx;
			box-sizing: border-box;
			line-height: 37upx;
		}
		.indicatorDots-te{
			color: #FFFFFF;
		}
	}
	.swiper-date{
		padding: 6upx 20upx;
		box-sizing: border-box;
		background-color:$them-page-color;
		color: #FFFFFF;
		position: absolute;
		display:inline-block;
		left: 23upx;
		bottom: 20upx;
		border-radius:30upx;
	}
</style>
